#list 练习

# classmates = ['Macheal', 'Bob', 'Tracy']
# print(classmates)
# print(len(classmates))
# print(classmates[0])
# print(classmates[1])
# print(classmates[2])
# print(classmates[3])

# 反向索引
# print(classmates[-1])
# print(classmates[-2])
# print(classmates[-3])
# print(classmates[-4])

# 追加元素到末尾
# classmates.append('Adam')

# 插入元素到指定位置
# classmates.insert(1, 'Jack')

# 删除list末尾元素
# classmates.pop()

# 删除指定位置元素
# classmates.pop(1)

# print(classmates)

# 元组练习

# classmates = ('Micheal', 'bob', 'Trace')

# t = (1, 2)

# t = (1,)

t = ('a', 'b', ['A', 'B'])

t[2][0] = 'X'
t[2][1] = 'Y'
print(t)

# tuple 指向不变 指向的对象自身可变
